package cn.t17.appsys.controller;

import cn.t17.appsys.dto.CommonResponse;
import cn.t17.appsys.service.AppCategoryService;
import cn.t17.appsys.service.DataDictionaryService;
import cn.t17.appsys.vo.AppCategoryVO;
import cn.t17.appsys.vo.DataDictionaryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * AppCategoryController class
 *
 * @author Administrator
 * @date 2021/9/16
 */
// 加了这个注解的请求，就会告诉浏览器，这个请求是允许跨域访问
@CrossOrigin(allowCredentials = "true")
@RestController
@RequestMapping("cate")
public class AppCategoryController extends BaseController {

    @Autowired
    private AppCategoryService appCategoryService;

    @RequestMapping(value = "query",method = RequestMethod.GET)
    public CommonResponse<List<AppCategoryVO>> query(Long parentId) {
        List<AppCategoryVO> appCategoryVOS =
                appCategoryService.listByParentId(parentId);

        return success(appCategoryVOS);
    }
}
